package zztest;

import java.net.Proxy;
import java.net.ProxySelector;
import java.net.URI;
import java.util.List;

public class ProxyDetector {
	public static void main(String[] args) throws Exception {
		List<Proxy> proxies = ProxySelector.getDefault().select(new URI("http://www.yahoo.com/"));
		
		//System.setProperty("java.net.useSystemProxies", "true");
		System.out.println(System.getProperty("java.net.useSystemProxies"));
		for (Proxy proxy : proxies) {
			System.out.println(""+proxy.type()+proxy.address());
		}
	}
}
